package com.syf.core.exception;

import java.io.PrintWriter;
import java.io.StringWriter;

public class ExceptionUtils {
    public static String getExceptionStackInfo(Exception e) {
        StringWriter stringWriter = new StringWriter();
        e.printStackTrace(new PrintWriter(stringWriter));
        return stringWriter.toString();
    }

    public static String getExceptionStackInfo(Throwable cause) {
        StringWriter stringWriter = new StringWriter();
        cause.printStackTrace(new PrintWriter(stringWriter));
        return stringWriter.toString();
    }
}
